package com.hsylient.javase.chapter05;

import lombok.SneakyThrows;
import org.junit.Test;

import java.io.FileReader;
import java.io.FileWriter;

public class G_FileCopy {

    @Test
    @SneakyThrows
    public void testCopy() {
        FileReader fileReader = new FileReader("D:\\IdeaProjects\\logger\\log\\JULCustomProperties.txt");
        FileWriter fileWriter = new FileWriter("yyy.txt");
        int readLen;
        char[] chars = new char[10];
        while ((readLen = fileReader.read(chars)) != -1) {
            fileWriter.write(chars, 0, readLen);
        }
        fileWriter.flush();
        fileReader.close();
        fileWriter.close();
    }
}
